package com.wits.qso.service;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.wits.platform.service.BaseService;
import com.wits.qso.dao.HWKAttachmentDao;
import com.wits.qso.dao.HomeworkDao;
import com.wits.qso.dao.HomeworkHDao;
import com.wits.qso.dao.HomeworkHViewDao;
import com.wits.qso.dao.StudentDao;
import com.wits.qso.dao.TeacherDao;
import com.wits.qso.entity.Homework;
import com.wits.qso.entity.HomeworkHView;

/**
 * 缴交作业流程服务
 */
@Component
public class HWKAttachmentService extends BaseService<Homework, String> {

	/**
	 * 缴交作业数据库操作类
	 */
	private HomeworkDao homeworkDao;
	/**
	 * 布置作业数据库操作类
	 */
	@Resource
	private HomeworkHDao homeworkHDao;
	/**
	 * 缴交作业附件数据库操作类
	 */
	@Resource
	private HWKAttachmentDao hwkAttachmentDao;

	/**
	 * 老师数据库操作类
	 */
	@Resource
	private TeacherDao teacherDao;
	/**
	 * 学生数据库操作类
	 */
	@Resource
	private StudentDao studentDao;

	/**
	 * 作业视图查询数据库操作类
	 */
	@Resource
	private HomeworkHViewDao homeworkHViewDao;

	@Resource
	public void setHomeworkDao(HomeworkDao homeworkDao) {
		this.baseDao = homeworkDao;
		this.homeworkDao = homeworkDao;
	}

	public HomeworkDao getHomeworkDao() {
		return homeworkDao;
	}

	public HomeworkHDao getHomeworkHDao() {
		return homeworkHDao;
	}

	public void setHomeworkHDao(HomeworkHDao homeworkHDao) {
		this.homeworkHDao = homeworkHDao;
	}

	public HWKAttachmentDao getHwkAttachmentDao() {
		return hwkAttachmentDao;
	}

	public void setHwkAttachmentDao(HWKAttachmentDao hwkAttachmentDao) {
		this.hwkAttachmentDao = hwkAttachmentDao;
	}

	public TeacherDao getTeacherDao() {
		return teacherDao;
	}

	public void setTeacherDao(TeacherDao teacherDao) {
		this.teacherDao = teacherDao;
	}

	public StudentDao getStudentDao() {
		return studentDao;
	}

	public void setStudentDao(StudentDao studentDao) {
		this.studentDao = studentDao;
	}

	public HomeworkHViewDao getHomeworkHViewDao() {
		return homeworkHViewDao;
	}

	public void setHomeworkHViewDao(HomeworkHViewDao homeworkHViewDao) {
		this.homeworkHViewDao = homeworkHViewDao;
	}

	/**
	 * 根据参数查询作业
	 * 
	 * @param params
	 * @return
	 */
	public List<Homework> findHomeworks(Map<String, Object> params) {
		return homeworkDao.findHomeworks(params);
	}
	
	/**
	 * 根据参数查询作业视图记录
	 * @param params
	 * @return 
	 */
	public List<HomeworkHView> findHomeworkHViews(Map<String,Object> params){
		return homeworkHViewDao.findHomeworkHViews(params);
	}
}
